package com.authority.dao;

import java.util.List;
import org.apache.ibatis.annotations.Param;

import com.authority.entry.AuthUserRoleDO;

public interface AuthUserRoleDAO {

	Long insertAuthUserRole(AuthUserRoleDO db);
	
	int updateAuthUserRole(AuthUserRoleDO db);
	
	int deleteAuthUserRoleByIds(String ids);
	
	AuthUserRoleDO queryAuthUserRoleById(Long id);
	
	/**
	 * 批量插入
	 * @param map
	 * @return
	 */
	void batchInsertAuthUserRole(List<AuthUserRoleDO> map);

	/**
	 * 批量删除
	 * @param ids
	 * @return
	 */
	int batchDeleteAuthUserRole(@Param("userId")Long userId,@Param("sysId")Long sysId);

	/**
	 * 根据用户id查角色
	 * @param userId
	 * @param sysId
	 * @return
	 */
	List<AuthUserRoleDO> queryRoleByUserId(@Param("userId")Long userId,@Param("sysId")Long sysId);
	
	/**
	 * 根据角色id查用户
	 * @param roleId
	 * @param sysId
	 * @return
	 */
	List<Long> queryUserIdListByRoleId(@Param("roleId")Long roleId,@Param("sysId")Long sysId);

}
